package com.qf.utils;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class JsonUtils {
    public static void toJsonString(Object object, HttpServletResponse response) throws IOException {
        PrintWriter pw = response.getWriter();
        String json = JSON.toJSONString(object);
        pw.print(json);
        pw.close();
    }
}
